<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ title }} - 股票新闻分析系统</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>

<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container">
            <a class="navbar-brand" href="/">股票新闻分析系统</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link" href="/">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/dashboard">仪表盘</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active" href="/reports">策略报告</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/llm_analysis">大模型分析</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <div class="container mt-4">
        <h2 class="mb-4">策略报告列表</h2>

        {% if reports %}
        <div class="row">
            {% for report in reports %}
            <div class="col-md-6 mb-4">
                <div class="card h-100">
                    <div class="card-header bg-primary text-white">
                        <h5 class="mb-0">{{ report.title }}</h5>
                    </div>
                    <div class="card-body">
                        <h6 class="card-subtitle mb-2 text-muted">日期: {{ report.date }}</h6>
                        <p class="card-text">{{ report.market_overview }}</p>
                        <div class="d-flex justify-content-between mt-3">
                            <span class="badge bg-info">推荐: {{ report.recommendation_count }}支股票</span>
                            <span class="badge bg-warning">风险等级: {{ report.risk_level }}</span>
                        </div>
                    </div>
                    <div class="card-footer bg-white text-end">
                        <a href="/report/{{ report.date }}" class="btn btn-primary">查看详情</a>
                    </div>
                </div>
            </div>
            {% endfor %}
        </div>
        {% else %}
        <div class="alert alert-info" role="alert">
            暂无策略报告。报告将在系统完成分析后自动生成。
        </div>
        {% endif %}

        <div class="row mt-4">
            <div class="col-12">
                <div class="card">
                    <div class="card-header bg-info text-white">
                        <h5 class="mb-0">关于策略报告</h5>
                    </div>
                    <div class="card-body">
                        <p>策略报告是基于新闻分析和市场趋势预测生成的投资建议集合。每份报告包含以下内容：</p>
                        <ul>
                            <li>市场整体趋势概览</li>
                            <li>个股买入/卖出/持有建议</li>
                            <li>行业分析</li>
                            <li>风险提示</li>
                        </ul>
                        <p>系统每日会自动生成新的策略报告，您可以通过本页面查看历史报告。</p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <footer class="bg-dark text-white text-center py-3 mt-5">
        <div class="container">
            <p class="mb-0">股票新闻分析系统 &copy; 2025 版权所有</p>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>

</html>